package com.zhangtai.modules.service.regular;


import com.zhangtai.modules.entity.regular.RegularBpmEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-09-17 20:44:04
 */

public interface RegularBpmService {

    @GetMapping("/findRegularBpmList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<RegularBpmEntity> getRegularList(@RequestParam(value = "type", required = false) List<Integer> type,
                                                       @RequestParam(value = "startDate", required = false) Date startDate,
                                                       @RequestParam(value = "name", required = false) String name,
                                                       @RequestParam(value = "code", required = false) String code,
                                                       @RequestParam(value = "endDate", required = false) Date endDate,
                                                       @RequestParam(value = "oid") Long oid,
                                                        @RequestParam(value="isRemind") boolean isRemind,
                                                       @RequestParam(value = "orgIds") List<Long> orgIds,
                                                       @RequestParam(value = "regularBpmStatus", required = false) List<Integer> regularBpmStatus,
                                                        @RequestParam(value = "orgId") List<Long> orgId,
                                                        @RequestParam(value = "unitId") List<Long> unitId,
                                                        @RequestParam(value = "jobId") List<Long> jobId,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoRegularBpm")
    @ApiOperation(value = "根据id查找")
    RegularBpmEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveRegularBpm")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody RegularBpmEntity entity);

    @PostMapping("/updateRegularBpm")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody RegularBpmEntity entity);

    @GetMapping("/deleteOneRegularBpm")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteRegularBpms")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

